package com.wkr.demo;

import com.wkr.bean.Fruit;
import com.wkr.factory.FruitFactory;

import java.util.*;

public class Main {


    public static void main(String[] args) {
        Some s = () -> 1;
        System.out.println(s.doOk());
        List<String>strings = Arrays.asList("abc", "", "bc", "efg", "abcd","", "jkl");
        strings.forEach(name->{ System.out.println(name);return;});
        // 获取空字符串的数量
        long count = strings.stream().filter(string -> string.length() > 2).count();
        System.out.println(count);
//        Operator.ADD.getType();
        String type = "ADD";
        Operator.valueOf(type).getType();
        System.out.println(Operator.ADD == (Operator.valueOf(type)));
        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                Fruit fruit = FruitFactory.valueOf("APPLE").getInstance();
                System.out.println(fruit.name);
            }
        };

        Fruit fruit = FruitFactory.valueOf("APPLE").getInstance();
        System.out.println(fruit.name);
        fruit = FruitFactory.valueOf("BANANA").getInstance();
        System.out.println(fruit.name);
    }


}
